function parentGet( id )
{
    return window.opener.document.getElementById( id );
}

function linkTo(assessmentIdentity, title)
{
    var tbody = parentGet( 'tbody-' + componentIdentity );
    
    // If the component isn't multivalued, remove existing references
    if( tbody.className != 'multivalued' )
        tbody.innerHTML = "";
    
    
    // Create the table structure
    var tr = document.createElement('tr');
    var td = document.createElement('td');
    
    // Create the main cell and hidden field to store the assessmentIdentity            
    var field = document.createElement('input');
    field.name  = componentIdentity + ":list";
    field.value = assessmentIdentity;
    field.type  = "hidden";
    
    // Contains the assessment name
    var span = document.createElement('span');
    span.innerHTML = title;
    
    // Finish the table structure
    td.appendChild( field );
    td.appendChild( span );
    tr.appendChild( td );
    
    // Create the actions cell to hold the 'remove' link
    var actionTD = document.createElement('td');
    actionTD.innerHTML = '<' + 'a href="#" onClick="removeThisRow(this); return false">Remove<' + '/a>';
    tr.appendChild( actionTD );
    
    
    tbody.appendChild( tr );

    
    window.close();
}